#include<iostream>
using namespace std;
//f(n) = f(n-1) + f(n-2)
int fib(int n)
{
    int num1 = 0;
    int num2 = 1;
    int num3;
    for(int i = 3; i <= n; i++)
    {
        num3  = num1 + num2;
        num1 = num2;
        num2 = num3;
    }   
    return num3;
}

int main()
{
    cout<<"enter a num:"<<endl;
    int n;
    cin>>n;
    cout<<"the n num is:"<<fib(n)<<endl;
    return 0;
}
